package com.yy.device.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 电磁阀-输出-类型枚举
 *
 * @author sunzhiqiang
 * @date 2022/6/21 15:18:50
 */
public enum SolenoidOutTypeEnum {
    /*硝化液回流*/
    DIGESTIVE_FLUID((short) 4),
    /*污泥回流*/
    SLUDGE_RETURN((short) 5),
    /*剩余污泥排放*/
    SLUDGE_DISCHARGE((short) 6),
    /*曝气装置*/
    AERATION((short) 7),
    /*清水池排水泵-潜水泵*/
    POOL_CLEANING((short) 1),
    /*污水进水泵*/
    SEWAGE_INTAKE((short) 0),
    /*气泵*/
    AIR_PUMPS((short) 3),

    ;

    @Getter
    private final short type;

    SolenoidOutTypeEnum(short type) {
        this.type = type;
    }

    public static SolenoidOutTypeEnum getEnumByType(short type) {
        return Arrays.stream(SolenoidOutTypeEnum.values())
                .filter(item -> item.getType() == type)
                .findFirst()
                .orElse(null);
    }
}
